import { createRouter, createWebHistory } from 'vue-router'

// 引入其他模块的路由
import { dashboardRoutes } from '@/modules/dashboard/router';
import HomeView from '../views/HomeView.vue'
import {loginRoutes} from "@/modules/auth/router";
import HeaderLayout from "@/layouts/HeaderLayout.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/homeView',
      name: 'HomeView',
      component: () => import('@/modules/dashboard/layouts/HomeView.vue'),
      children:[
        ...dashboardRoutes,
      ],
    },
    {
      path: '/headerLayout',
      component: HeaderLayout,
      children: [
        {
          path: '/',
          name: 'home',
          component: HomeView,
        },
        {
          path: '/about',
          name: 'about',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/AboutView.vue'),
        },


        // 引入并合并数据大屏的路由
        ...loginRoutes
      ],
    },

  ],

})

export default router
